Skip to content

Allow assets to have continuous (non-tranched) capacities - #1573

Open
tsmbland wants to merge 6 commits into
multi_investment_algorithms_prepfrom
continuous_capacities
Open

tsmbland wants to merge 6 commits into
multi_investment_algorithms_prepfrom
continuous_capacities

Conversation

@tsmbland

@tsmbland tsmbland commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This one was frustrating. Adam wants the new asset selection algorithm (#1574) to not use tranching, which means adding back the ability for assets to have continuous capacities, after we recently removed this ability.

Fortunately a lot of this was just reverting previous commits and fixing up conflicts. I needed a way for mothballing to work with continuous capacities, so rather than storing tranche counts it now stores AssetCapacitys. The output files have a few columns representing tranche counts, so I've made it so these are blank for assets with continuous capacities.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc
  • Update release notes for the latest release if this PR adds a new feature or fixes a bug
    present in the previous release

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@tsmbland
tsmbland changed the base branch from main to circularity_milp October 29, 2026 11:14
@tsmbland
tsmbland force-pushed the continuous_capacities branch from f8a04d9 to bf2a63f Compare October 29, 2026 13:38
github-actions[bot]

This comment was marked as outdated.

@tsmbland
tsmbland force-pushed the continuous_capacities branch 2 times, most recently from 8ce12fb to a9d1198 Compare November 4, 2026 13:48
@tsmbland
tsmbland changed the base branch from circularity_milp to multi_investment_algorithms_prep November 4, 2026 13:49
@tsmbland tsmbland changed the title Restore continuous capacities Allow assets to have continuous (non-tranched) capacities Nov 4, 2026
@tsmbland
tsmbland force-pushed the continuous_capacities branch from a9d1198 to ed42637 Compare November 9, 2026 15:50
@tsmbland
tsmbland marked this pull request as ready for review November 9, 2026 16:06
@tsmbland
tsmbland requested a balanced review from Copilot November 9, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Partial continuous mothballing and decommissioning lack lifecycle test coverage, and the output schema does not document that tranche counters are empty for continuous capacities.

2 open issues
What changed in this PR

Restores continuous asset capacities in MUSE2, preparing for the non-tranched asset-selection algorithm in #1574 while preserving discrete-capacity support.

Changes:

  • Adds continuous capacity representation and capacity-based mothballing and decommissioning.
  • Treats input assets without tranche settings as continuous and leaves their output tranche counts blank.
  • Updates input documentation, unit tests and regression expectations.
File Description
tests/​data/​two_regions/​asset_capacities.csv Expects blank continuous-asset tranche counts.
tests/​data/​two_outputs/​asset_capacities.csv Updates tranche-count expectations.
tests/​data/​simple/​asset_capacities.csv Updates baseline tranche-count expectations.
tests/​data/​simple_tranche_size/​asset_capacities.csv Preserves explicit tranches alongside continuous assets.
tests/​data/​simple_shadow/​asset_capacities.csv Updates shadow-pricing output expectations.
tests/​data/​simple_npv/​asset_capacities.csv Updates net-present-value output expectations.
tests/​data/​simple_mothball/​asset_capacities.csv Updates continuous mothballing output expectations.
tests/​data/​simple_marginal/​asset_capacities.csv Updates marginal-pricing output expectations.
tests/​data/​simple_marginal_average/​asset_capacities.csv Updates average marginal-pricing expectations.
tests/​data/​simple_ironing_out/​asset_capacities.csv Updates ironing-out scenario expectations.
tests/​data/​simple_full/​asset_capacities.csv Updates full-output scenario expectations.
tests/​data/​muse1_default/​asset_capacities.csv Updates default-example tranche counts.
tests/​data/​missing_commodity/​asset_capacities.csv Updates missing-commodity scenario expectations.
tests/​data/​circularity/​asset_capacities.csv Updates circularity scenario expectations.
tests/​data/​circularity_npv/​asset_capacities.csv Updates circularity valuation expectations.
src/​simulation/​investment/​competitive.rs Adapts selection to capacity-based unmothballing.
src/​output.rs Serialises optional tranche counts.
src/​input/​asset.rs Loads assets without tranche settings as continuous.
src/​fixture.rs Uses the discrete-capacity constructor.
src/​asset/​pool.rs Tracks unretained capacity rather than tranche counts.
src/​asset/​capacity.rs Adds continuous and discrete capacity variants.
src/​asset.rs Converts lifecycle bookkeeping to capacity amounts.
schemas/​input/​processes.yaml Documents the continuous-capacity fallback.
schemas/​input/​assets.yaml Explains omitted tranche settings.
docs/​model/​investment.md Describes continuous assets and current selection behaviour.

Review effort: Balanced

Comment thread src/asset.rs Resolved
Comment thread src/output.rs Resolved
@tsmbland
tsmbland requested a review from alexdewar November 9, 2026 16:16
@tsmbland
tsmbland added this pull request to stack #1584 November 10, 2026 11:27
@tsmbland
tsmbland force-pushed the continuous_capacities branch from b2a4f17 to d850ace Compare November 10, 2026 11:53
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.02454% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.13%. Comparing base (c241bd6) to head (d850ace).

Files with missing lines Patch % Lines
src/asset.rs 85.33% 8 Missing and 3 partials ⚠️
src/asset/capacity.rs 97.22% 2 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           multi_investment_algorithms_prep    #1573      +/-   ##
====================================================================
- Coverage                             89.21%   89.13%   -0.09%     
====================================================================
  Files                                    63       63              
  Lines                                  9209     9259      +50     
  Branches                               9209     9259      +50     
====================================================================
+ Hits                                   8216     8253      +37     
- Misses                                  676      686      +10     
- Partials                                317      320       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tsmbland
tsmbland removed this pull request from stack #1584 November 10, 2026 15:58
@tsmbland
tsmbland added this pull request to stack #1588 November 10, 2026 16:00
@tsmbland
tsmbland removed this pull request from stack #1588 November 11, 2026 16:29
@tsmbland
tsmbland added this pull request to stack #1594 November 11, 2026 16:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants